﻿using System.Configuration;

namespace Our.Umbraco.Tree.Elmah.Configuration
{
	// <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data/Elmah" />
	public class ErrorLogSection : ConfigurationSection
	{
		/// <summary>
		/// The name of the 'type' property attribute
		/// </summary>
		internal const string TypePropertyName = "type";

		/// <summary>
		/// Gets or sets the type.
		/// </summary>
		/// <value>The type.</value>
		[ConfigurationProperty(TypePropertyName, IsRequired = true, IsKey = false, IsDefaultCollection = false, DefaultValue = "Elmah.XmlFileErrorLog, Elmah")]
		public string Type
		{
			get { return (string)base[TypePropertyName]; }
			set { base[TypePropertyName] = value; }
		}

		/// <summary>
		/// The name of the 'logPath' property attribute
		/// </summary>
		internal const string LogPathPropertyName = "logPath";

		/// <summary>
		/// Gets or sets the path.
		/// </summary>
		/// <value>The path.</value>
		[ConfigurationProperty(LogPathPropertyName, IsRequired = true, IsKey = false, IsDefaultCollection = false, DefaultValue = "~/App_Data/Elmah")]
		public string LogPath
		{
			get { return (string)base[LogPathPropertyName]; }
			set { base[LogPathPropertyName] = value; }
		}

	}
}
